


***********************************************
****** The Impact of Soft-Skills Training *****
******    for Entrepreneurs in Jamaica    *****
***********************************************


* This file merges the data coming from the two questionnaires for the baseline, and prepares them for the analysis
* (q_ indicates variables from Qualtrics survey, m_  indicates variables from SurveyMonkey)


clear all
cap log close
set more off

cap cd "$directory"



************
*** Data ***
************

*** Merge baseline data ***

* Load Qualtrics data, add q_ prefix and save
use "$data_int/bas_data_qualtrics_cleaned", clear
rename q* q_q*
tempfile qualtrics
save `qualtrics'

* Load MonkeySurvey data and add m_prefix
use "$data_int/bas_data_monkey_cleaned", clear
rename q* m_q*

* Merge two datasets together
merge 1:1 respondent_id using `qualtrics', gen(merge_baseline)
lab var merge_baseline "Merge Qualtrics and MonkeySurvey"
lab def merge_base 1 "SurveyMonkey only" 2 "Qualtrics only" 3 "SurveyMonkey and Qualtrics"
lab val merge_baseline merge_base


*** Merge with other data ***

* Merge with treatment assignment
merge 1:1 respondent_id using "$data_int/treatment_assignment", assert(match using) keep(match) nogen
order treatment t1 t2 strata, after(respondent_id)

* Merge with attendance data
preserve
import excel using "$data_raw/course_attendance", clear firstrow
tempfile attendance
save `attendance'
restore
merge 1:1 respondent_id using `attendance', assert(master match) nogen

* Merge with evaluation data
preserve
import excel using "$data_raw/course_evaluation", clear firstrow
tempfile evaluation
save `evaluation'
restore
merge 1:1 respondent_id using `evaluation', assert(master match) nogen


*** Define and assign labels ***

lab def yn 0 "No" 1 "Yes", modify


**********************************
*** Respondent characteristics ***
**********************************

*** Merge existing variables ***

* Self-employment
gen q_selfemp=(q_q6==1) if !mi(q_q6)
gen selfemp=(m_q6==1) if !mi(m_q6)
replace selfemp=q_selfemp if merge_baseline==2
drop q_selfemp
lab var selfemp "Self employed in own business"
lab val selfemp yn

* Gender
gen q_female=(q_q39==2) if !mi(q_q39)
gen female=(m_q39==2) if !mi(m_q39)
replace female=q_female if merge_baseline==2
drop q_female
lab var female "Female"
lab val female yn

* Age
gen q_age=16+q_q40
gen age=2016-m_q40
replace age=q_age if merge_baseline==2
replace age=. if age<16 | age>90
drop q_age
lab var age "Age"

* Ethnicity
gen q_black=(q_q41==1) if !mi(q_q41)
gen black=(m_q41==1) if !mi(m_q41)
replace black=q_black if merge_baseline==2
drop q_black
lab var black "Black"
lab val black yn

* Education
gen q_edu_sec_more=(q_q42>=6 & q_q42<=10) if !mi(q_q42)
gen edu_sec_more=(m_q42>6 & m_q42<=10) if !mi(m_q42)
replace edu_sec_more=q_edu_sec_more if merge_baseline==2
drop q_edu_sec_more
lab var edu_sec_more "Education: more than secondary"
lab val edu_sec_more yn

* Relationship status
gen q_married=(q_q43==1 | q_q43==6) if !mi(q_q43)
gen married=(m_q43==1 | m_q43==6) if !mi(m_q43)
replace married=q_married if merge_baseline==2
drop q_married
lab var married "Married"
lab val married yn

* Number of children
gen q_num_children=q_q44
gen num_children=m_q44
replace num_children=q_num_children if merge_baseline==2
drop q_num_children
lab var num_children "N. of children"

* Internet access
gen q_internet_access=(q_q45==4) if !mi(q_q45)
gen internet_access=(m_q45==1) if !mi(m_q45)
replace internet_access=q_internet_access if merge_baseline==2
drop q_internet_access
lab var internet_access "Has internet access"
lab val internet_access yn

* Parents entrepreneurs
gen q_parents_entrep=(q_q46==1) if !mi(q_q46)
gen parents_entrep=(m_q46==1) if !mi(m_q46)
replace parents_entrep=q_parents_entrep if merge_baseline==2
drop q_parents_entrep
lab var parents_entrep "Parents entrepreneurs"
lab val parents_entrep yn

* Bank saving
gen q_save_bank=(q_q47_1==1)
gen save_bank=(m_q47_1==1)
replace save_bank=q_save_bank if merge_baseline==2
drop q_save_bank
lab var save_bank "Saves in bank account"
lab val save_bank yn

* Loans for business
gen q_loan_bank=(q_q48_1==1)
gen q_loan_notaccess=(q_q48_5==1)
gen loan_bank=(m_q48_1==1)
gen loan_notaccess=(m_q48_5==7)
replace loan_bank=q_loan_bank if merge_baseline==2
replace loan_notaccess=q_loan_notaccess if merge_baseline==2
drop q_loan_bank q_loan_notaccess
lab var loan_bank "Can get bank loan for business"
lab var loan_notaccess "Cannot get any loans for business"
lab val loan_bank loan_notaccess yn

* Goal setting
gen q_set_goal=(q_q49==1) if !mi(q_q49)
gen set_goal=(m_q49==1) if !mi(m_q49)
replace set_goal=q_set_goal if merge_baseline==2
drop q_set_goal
lab var set_goal "Set a goal for business"
lab val set_goal yn

* Changing the business
gen q_business_wchange=(q_q51==1) if !mi(q_q51)
gen business_wchange=(m_q51==1) if !mi(m_q51)
replace business_wchange=q_business_wchange if merge_baseline==2
drop q_business_wchange
lab var business_wchange "Wants to change sth in business"
lab val business_wchange yn

* Job satisfaction (0-6)
gen q_satisfied_job=q_q53_1-11
gen satisfied_job=m_q53_1-1
replace satisfied_job=q_satisfied_job if merge_baseline==2
drop q_satisfied_job
lab var satisfied_job "Satisfied with the job (0-6)"

* Reservation wage
destring q_q54, gen(q_reservation_wage) force
destring m_q54, gen(reservation_wage) force
replace reservation_wage=q_reservation_wage if merge_baseline==2
drop q_reservation_wage
lab var reservation_wage "Reservation wage"

* Willingness to take risks
gen q_risk_willing=q_q62-1
gen risk_willing=m_q62-1
replace risk_willing=q_risk_willing if merge_baseline==2
drop q_risk_willing
lab var risk_willing "Willingness to take risks (0-10)"

* Household expenditures
destring q_q29, gen(q_expenditures) force
destring m_q29, gen(expenditures) force
replace expenditures=q_expenditures if merge_baseline==2
drop q_expenditures
lab var expenditures "Household expenditures last month"

* Business course
gen q_pre_course=(q_q30==1) if !mi(q_q30)
gen pre_course=(m_q30==1) if !mi(m_q30)
replace pre_course=q_pre_course if merge_baseline==2
drop q_pre_course
lab var pre_course "Took previous business course"
lab val pre_course yn


*** Create new variables ***

* Firm survival (copy of selfemp at baseline)
gen has_business=selfemp
lab var has_business "Owns a business"
lab val has_business yn



****************************
*** Firm characteristics ***
****************************

*** Merge existing variables ***

* Continuous operations
gen q_active_business=(q_q9==1) if !mi(q_q9)
gen active_business=(m_q9==1) if !mi(m_q9)
replace active_business=q_active_business if merge_baseline==2
drop q_active_business
lab var active_business "Operated continuously last 12 m."
lab val active_business yn

* Business age
gen q_busage_0=(q_q12==38) if !mi(q_q12)
gen q_busage_l1=(q_q12==38 | q_q12== 2 | q_q12==21) if !mi(q_q12)
gen busage_0=(m_q12==9) if !mi(m_q12)
gen busage_l1=(m_q12==9 | m_q12==2 | m_q12==1) if !mi(m_q12)
replace busage_0=q_busage_0 if merge_baseline==2
replace busage_l1=q_busage_l1 if merge_baseline==2
drop q_busage_0 q_busage_l1
lab var busage_0 "Business age: not in operation yet"
lab var busage_l1 "Business age: 1 year or less"
lab val busage_l1 yn

* Employees
gen q_has_employees=(q_q13==1) if !mi(q_q13)
gen has_employees=(m_q13==1) if !mi(m_q13)
replace has_employees=q_has_employees if merge_baseline==2
drop q_has_employees
lab var has_employees "Has employees"
lab val has_employees yn

* Accounting
gen q_formal_accounts=(q_q15==1) if !mi(q_q15)
gen q_informal_accounts=(q_q15==2) if !mi(q_q15)
gen formal_accounts=(m_q15==1) if !mi(m_q15)
gen informal_accounts=(m_q15==2) if !mi(m_q15)
replace formal_accounts=q_formal_accounts if merge_baseline==2
replace informal_accounts=q_informal_accounts if merge_baseline==2
drop q_formal_accounts q_informal_accounts
lab var formal_accounts "Keeps formal accounts"
lab var informal_accounts "Keeps informal accounts"
lab val formal_accounts informal_accounts yn

* Registration with Companies Office of Jamaica
gen q_register_bus=(q_q24==1) if !mi(q_q24)
gen register_bus=(m_q24==1) if !mi(m_q24)
replace register_bus=q_register_bus if merge_baseline==2
drop q_register_bus
lab var register_bus "Registered business"
lab val register_bus yn

* Innovation
gen q_innovation=(q_q25==4) if !mi(q_q25)
gen innovation=(m_q24==1) if !mi(m_q24)
replace innovation=q_innovation if merge_baseline==2
drop q_innovation
lab var innovation "Introduced innovation"
lab val innovation yn

* Barriers to growth
gen q_barriers_couple=(q_q63_2==1)
gen barriers_couple=(m_q63_2==2)
replace barriers_couple=q_barriers_couple if merge_baseline==2
drop q_barriers_couple
lab var barriers_couple "Barrier to bus. growth: couple"
lab val barriers_couple yn


*** Create new variables ***

* Employees for Qualtrics survey
gen q_pemployees=0.5*q_q14_2_text
egen q_total_employees=rowtotal(q_q14_1_text q_pemployees) if merge_baseline==2, missing
drop q_pemployees
replace q_total_employees=0 if has_employees==0 & merge_baseline==2
gen q_employees_fulltime=q_q14_1_text
replace q_employees_fulltime=0 if has_employees==0 & merge_baseline==2
replace q_employees_fulltime=0 if !mi(q_total_employees) & mi(q_employees_fulltime) & merge_baseline==2
 
* Employees for MonkeySurvey
gen pemployees=0.5*m_q14_2_text
gen employees_fulltime=m_q14_1_text
egen total_employees=rowtotal(m_q14_1_text pemployees) if merge_baseline!=2, missing
drop pemployees
replace total_employees=0 if has_employees==0 & merge_baseline!=2
replace employees_fulltime=0 if has_employees==0 & merge_baseline!=2
replace employees_fulltime=0 if !mi(total_employees) & mi(employees_fulltime) & merge_baseline!=2

* Merge employees for Qualtrics and MonkeySurvey
replace total_employees=q_total_employees if merge_baseline==2
replace employees_fulltime=q_employees_fulltime if merge_baseline==2
drop q_total_employees q_employees_fulltime
lab var employees_fulltime "N. of full-time employees"
lab var total_employees "N. of employees"

* Parttime
gen q_employees_parttime=q_q14_2_text
gen employees_parttime=m_q14_2_text
replace employees_parttime=q_employees_parttime if merge_baseline==2
drop q_employees_parttime
replace employees_parttime=0 if has_employees==0
lab var employees_parttime "N. of part-time employees"



**************************
*** Business variables ***
**************************

*** Merge existing variables ***

* Amount of sales
gen q_sales_lastm=q_q21_1_text
gen q_sales_typm=q_q21_2_text
gen sales_lastm=m_q21_1_text
gen sales_typm=m_q21_2_text
replace sales_lastm=q_sales_lastm if merge_baseline==2
replace sales_typm=q_sales_typm if merge_baseline==2
drop q_sales_lastm q_sales_typm
replace sales_lastm=0 if selfemp==0
replace sales_typm=0 if selfemp==0
lab var sales_lastm "Sales in the last month"
lab var sales_typm "Sales in a typical month"

* Amount of costs
gen q_costs_lastm=q_q22_1_text
gen q_costs_typm=q_q22_2_text
gen costs_lastm=m_q22_1_text 
gen costs_typm=m_q22_2_text
replace costs_lastm=q_costs_lastm if merge_baseline==2
replace costs_typm=q_costs_typm if merge_baseline==2
drop q_costs_lastm q_costs_typm
replace costs_lastm=0 if selfemp==0
replace costs_typm=0 if selfemp==0
lab var costs_lastm "Total costs in the last month"
lab var costs_typm "Total costs in a typical month"

* Amount of profits
gen q_profits_lastm=q_q23_1_text
gen q_profits_typm=q_q23_2_text
gen profits_lastm=m_q23_1_text 
gen profits_typm=m_q23_2_text
replace profits_lastm=q_profits_lastm if merge_baseline==2
replace profits_typm=q_profits_typm if merge_baseline==2
drop q_profits_lastm q_profits_typm
replace profits_lastm=0 if selfemp==0
replace profits_typm=0 if selfemp==0
lab var profits_lastm "Profits in the last month"
lab var profits_typm "Profits in a typical month"

* Business practices
forvalues i=1/7 {
	gen busprac_`i'=.
	replace busprac_`i'=q_q64_`i' if !missing(q_q64_`i')
	replace busprac_`i'=m_q64_`i' if !missing(m_q64_`i')
	lab var busprac_`i' "Business practice `i'"
}
recode busprac_* (2 = 0)
lab val busprac_* yn


*** Generate new variables ***

* Dummy for positive profits
gen pos_profits_lastm=(profits_lastm>0) if !missing(profits_lastm)
lab var pos_profits_lastm "Positive profits in the last month"


*** Impute values for typical month ***

* Impute values for typical month using last month values
foreach var in sales costs profits {
	gen imputed_`var'=0
	replace imputed_`var'=1 if `var'_typm==. & `var'_lastm!=.
	replace `var'_typm=`var'_lastm if `var'_typm==. & `var'_lastm!=.
}

* Replace with 0 when other accounting variables are 0
replace sales_typm=0 if costs_typm==0 & profits_typm==0 & sales_typm==.
replace costs_typm=0 if sales_typm==0 & (profits_typm==0 | profits_typm==.) & costs_typm==.
replace profits_typm=0 if (costs_typm==0 | costs_typm==.) & sales_typm==0 & profits_typm==.

* Replace with 0 for business that are not yet in operation
replace sales_typm=0 if busage_0==1 & sales_typm==. & (costs_typm==. | costs_typm==0) & (profits_typm==. | profits_typm==0)
replace costs_typm=0 if busage_0==1 & costs_typm==. & sales_typm==0
replace profits_typm=0 if busage_0==1 & profits_typm==. & sales_typm==0  
replace sales_typm=0 if active_business==0 & sales_typm==. & (costs_typm==. | costs_typm==0) & (profits_typm==. | profits_typm==0)
replace costs_typm=0 if active_business==0 & costs_typm==. & (sales_typm==. | sales_typm==0) & (profits_typm==. | profits_typm==0)
replace profits_typm=0 if active_business==0 & profits_typm==. & (sales_typm==. | sales_typm==0) & (costs_typm==. | costs_typm==0)



**************************
*** Course preferences ***
**************************

* Preferred location for the course
gen q_course_kingston=(q_q33_1==1)
gen q_course_clarendon=(q_q33_2==1)
gen q_course_stthomas=(q_q33_4==1)
gen q_course_stcatherine=(q_q33_5==1)
gen course_kingston=(m_q33_1==1)
gen course_clarendon=(m_q33_2==2)
gen course_stthomas=(m_q33_4==3)
gen course_stcatherine=(m_q33_5==4)
replace course_kingston=q_course_kingston if merge_baseline==2
replace course_clarendon=q_course_clarendon if merge_baseline==2
replace course_stthomas=q_course_stthomas if merge_baseline==2
replace course_stcatherine=q_course_stcatherine if merge_baseline==2
drop q_course_*
lab var course_kingston "Course in Kingston"
lab var course_clarendon "Course in Clarendon"
lab var course_stthomas "Course in St. Thomas"
lab var course_stcatherine "Course in St. Catherine"
lab val course_kingston course_clarendon course_stthomas course_stcatherine yn



*************************
*** Course attendance ***
*************************

*** Edit existing variables ***

* Course attendance by week
forvalues i=1/10 {
	rename Week`i' attend_week`i'
	lab var attend_week`i' "Attended week `i'"
}
lab val attend_week* yn


*** Generate new variables ***

* Number of classes attended
egen total_attend=rowtotal(attend_week*), missing
egen attend_first=rowtotal(attend_week1-attend_week5), missing
egen attend_second=rowtotal(attend_week6-attend_week10), missing
gen log_attend=ln(total_attend)
gen log_attend_first=ln(attend_first)
gen log_attend_second=ln(attend_second)
lab var total_attend "Total attendance"
lab var attend_first "Attendance 1st part"
lab var attend_second "Attendance 2nd part"
lab var log_attend "Log attendance"
lab var log_attend_first "Log attendance 1st part"
lab var log_attend_second "Log attendance 2nd part"

* Attendance dummies
gen atleast1=total_attend>=1 if !mi(total_attend) 
gen atleast5=total_attend>=5 if !mi(total_attend) 
lab var atleast1 "Attended at least 1 class"
lab var atleast5 "Attended at least 5 classes"



*************************
*** Course evaluation ***
*************************

*** Edit existing variables ***

* Course satisfaction
foreach var of varlist satisf_cont satisf_deliv satisf_exerc satisf_dura satisf_diff satisf_relev satisf_overall likely_skills likely_recom {
	replace `var'="" if `var'=="NA"
	destring `var', replace
}
lab var satisf_cont "Course satisfaction: content" 
lab var satisf_deliv "Course satisfaction: delivery" 
lab var satisf_exerc "Course satisfaction: homework" 
lab var satisf_dura "Course satisfaction: duration"
lab var satisf_diff "Course satisfaction: difficulty"
lab var satisf_relev "Course satisfaction: relevance"
lab var satisf_overall "Course satisfaction: overall"
lab var likely_skills "Likelihood to use the skills"
lab var likely_recom "Likelihood to recommend the course"

* Willingness to pay for the course
rename amount_jmd wtp_jmd
replace wtp_jmd="" if wtp_jmd=="NA"
destring wtp_jmd, replace
lab var wtp_jmd "Willingness to pay for course (JMD)"

* Course assessment
lab var knwl_pi "Correct answer: personal initiative"
lab var knwl_bp_1 "Correct answer: business practices 1"
lab var knwl_bp_2 "Correct answer: business practices 2"
lab var knwl_ps_1 "Correct answer: perseverance 1"
lab var knwl_ps_2 "Correct answer: perseverance 2"
lab val knwl_* yn


*** Create new variables ***

* Course satisfaction index
egen satisf_index=rowmean(satisf_cont satisf_deliv satisf_exerc satisf_dura satisf_diff satisf_relev satisf_overall)
lab var satisf_index "Course satisfaction index"



**********************************
*** Variables for the analysis ***
**********************************

*** Transform variables ***

* Winsorize variables (only top 99%)
foreach var of varlist sales_lastm sales_typm costs_lastm {
	clonevar win_`var'=`var'
	summ `var' if selfemp==1, de
	replace win_`var'=r(p99) if win_`var'>r(p99) & !mi(win_`var')
	lab var win_`var' "Winsorized `= strlower("`: var lab `var''")'"
}

* Winsorize variables (bottom 1% and top 99%)
foreach var of varlist profits_lastm profits_typm {
	clonevar win_`var'=`var'
	summ `var' if selfemp==1, de
	replace win_`var'=r(p1) if win_`var'<r(p1) & !mi(win_`var')
	replace win_`var'=r(p99) if win_`var'>r(p99) & !mi(win_`var')
	lab var win_`var' "Winsorized `= strlower("`: var lab `var''")'"
}

* Transform monetary variable with inverse hypebolic sine (IHS)
foreach var of varlist sales_lastm sales_typm profits_lastm profits_typm {
	gen ihs_`var'=ln(`var' + sqrt(`var'^2+1))
	lab var ihs_`var' "IHS of `= strlower("`: var lab `var''")'"
}


*** Create sales and profits index ***

* Compute z-scores
foreach var of varlist sales_lastm win_sales_lastm ihs_sales_lastm profits_lastm win_profits_lastm ihs_profits_lastm {
	summ `var' if treatment==0
	gen z_`var'=(`var'-r(mean))/r(sd)
	lab var z_`var' "Z-score: `: var lab `var''"
}

* Generate sales and profits index
egen sales_profits_index=rowmean(z_sales_lastm z_win_sales_lastm z_ihs_sales_lastm z_profits_lastm z_win_profits_lastm z_ihs_profits_lastm)
lab var sales_profits_index "Sales and profits index"

* Replace sales and profits index with missing if any component is missing
replace sales_profits_index=. if mi(sales_lastm) | mi(profits_lastm)

* Standardize sales and profits index
summ sales_profits_index if treatment==0
replace sales_profits_index=(sales_profits_index-r(mean))/r(sd)


*** Create capital and labor index ***

* Compute z-scores
foreach var of varlist total_employees employees_fulltime employees_parttime {
	summ `var' if treatment==0
	gen z_`var'=(`var'-r(mean))/r(sd)
	lab var z_`var' "Z-score: `: var lab `var''"
}

* Replace z-scores of investment variables with 0 (they are missing values because the SD -the denominator- is 0)
gen z_investment=0
gen z_win_investment_amount=0

* Generate capital and labor index (simplified)
egen inputs_index=rowmean(z_total_employees z_employees_fulltime z_employees_parttime z_investment z_win_investment_amount)
lab var inputs_index "Capital and labor inputs index (simple)"


*** Create business practices index ***

* Generate indexes as a share of business practices adopted (i.e. going 0-1)
egen business_practices_index=rowmean(busprac_*)
lab var business_practices_index "Business practices index"


*** Create perseverance index ***

* Compute z-scores
foreach var of varlist ?_q59_1 ?_q59_2 ?_q59_3 ?_q59_4 ?_q61_3 ?_q61_4 {
	summ `var' if treatment==0
	gen z_`var'=(`var'-r(mean))/r(sd)
	lab var z_`var' "Z-score: `: var lab `var''"
}

* Generate perseverance index (as simple mean of its components)
egen q_perseverance=rowmean(q_q59_1 q_q59_2 q_q59_3 q_q59_4 q_q61_3 q_q61_4)
egen perseverance=rowmean(m_q59_1 m_q59_2 m_q59_3 m_q59_4 m_q61_3 m_q61_4)
replace perseverance=q_perseverance if merge_baseline==2
drop q_perseverance
lab var perseverance "Perseverance"


*** Create personal initiative indexes ***

* Generate personal initiative index (as simple mean of its components)
egen q_personal_initiative=rowmean(q_q57_1 q_q57_2 q_q57_3 q_q58_1 q_q58_2 q_q58_3 q_q58_4)
egen personal_initiative=rowmean(m_q57_1 m_q57_2 m_q57_3 m_q58_1 m_q58_2 m_q58_3 m_q58_4)
replace personal_initiative=q_personal_initiative if merge_baseline==2
drop q_personal_initiative
lab var personal_initiative "Personal initiative"

* Compute z-scores
foreach var of varlist ?_q57_1 ?_q57_2 ?_q57_3 ?_q58_1 ?_q58_2 ?_q58_3 ?_q58_4 {
	summ `var' if treatment==0
	gen z_`var'=(`var'-r(mean))/r(sd)
	lab var z_`var' "Z-score: `: var lab `var''"
}

* Generate personal initiative index (with z-scores of components)
egen q_personal_initiative_index=rowmean(z_q_q57_1 z_q_q57_2 z_q_q57_3 z_q_q58_1 z_q_q58_2 z_q_q58_3 z_q_q58_4)
egen personal_initiative_index=rowmean(z_m_q57_1 z_m_q57_2 z_m_q57_3 z_m_q58_1 z_m_q58_2 z_m_q58_3 z_m_q58_4)
replace personal_initiative_index=q_personal_initiative_index if merge_baseline==2
drop q_personal_initiative_index
lab var personal_initiative_index "Personal initiative index"

* Standardize personal initiative index
summ personal_initiative_index if treatment==0
replace personal_initiative_index=(personal_initiative_index-r(mean))/r(sd)


*** Create locus of control index ***

* Generate locus of control index (as simple mean of its components)
egen q_locus_control=rowmean(q_q60_1 q_q60_2 q_q60_3 q_q61_1 q_q61_2)
egen locus_control=rowmean(m_q60_1 m_q60_2 m_q60_3 m_q61_1 m_q61_2)
replace locus_control=q_locus_control if merge_baseline==2
drop q_locus_control
lab var locus_control "Locus of control"


*** Generate additional variables ***

* Generate baseline variables for loan_requested
clonevar loan_requested=loan_bank



**************
*** Saving ***
**************


* Additional correction to number of employees
replace has_employees=0 if total_employees==0
replace has_employees=1 if total_employees>0 & total_employees<.
replace employees_parttime=0 if has_employees==0

* Save dataset
compress
save "$data_fin/bas_data_final", replace


